<template>
  <view class="city-bg">
    <!-- 顶部栏 -->
    <view class="city-header">
      <view class="city-header-left">
        <image src="/static/yyq/img.png" style="width: 15px;height: 20px;margin-right: 5px"></image>
      </view>
      <view class="city-header-title">选择城市</view>
    </view>
    <!-- 当前定位 -->
    <view class="city-location-row">
      <text>当前定位：</text>
      <text class="city-location">焦作市</text>
      <view class="city-reposition">
        <image src="/static/yyq/sx.png" style="width: 15PX;height: 15PX;margin-right: 5px"></image>
        <text>重新定位</text>
      </view>
    </view>
    <!-- 热门城市 -->
    <view class="city-hot-card">
      <view class="city-hot-title">热门城市</view>
      <view class="city-hot-list">
        <view v-for="(city, idx) in hotCities" :key="idx" class="city-hot-item">{{ city }}</view>
      </view>
    </view>
    <!-- 字母分组城市 -->
    <view class="city-list-card">
      <view class="city-list-letter">A</view>
      <view class="city-list-item" v-for="(city, idx) in aCities" :key="idx">{{ city }}</view>
    </view>
  </view>
</template>

<script setup>
import { ref } from 'vue';
const hotCities = ref([
  '北京市', '北京市', '北京市',
  '南京市', '南京市', '南京市',
  '武汉市', '武汉市', '武汉市',
  '深圳市', '深圳市', '深圳市',
]);
const aCities = ref([
  '安庆市', '安阳市', '安顺市', '鞍山市', '安康市'
]);
</script>

<style scoped lang="scss">
.city-bg {
  min-height: 100vh;
  background: linear-gradient(180deg, #338aff 0%, #338aff 120px, #f5f6fa 120px, #f5f6fa 100%);
}
.city-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 16px;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
}
.city-header-left, .city-header-right {
  display: flex;
  align-items: center;
}
.city-header-title {
  flex: 1;
  text-align: center;
  font-size: 20px;
  font-weight: bold;
}
.iconfont {
  font-family: 'iconfont';
  font-style: normal;
  font-size: 20px;
  margin: 0 4px;
}
.city-location-row {
  display: flex;
  align-items: center;
  padding: 0 20px;
  margin-top: 8px;
  color: #fff;
  font-size: 16px;
}
.city-location {
  font-weight: bold;
  margin: 0 8px;
}
.city-reposition {
  display: flex;
  align-items: center;
  margin-left: auto;
  font-size: 14px;
}
.city-hot-card {
  background: #fff;
  border-radius: 16px;
  margin: 16px 16px 0 16px;
  padding: 16px 0 8px 0;
  box-shadow: 0 2px 8px rgba(51,138,255,0.04);
}
.city-hot-title {
  font-size: 16px;
  font-weight: bold;
  margin-left: 20px;
  margin-bottom: 8px;
}
.city-hot-list {
  display: flex;
  flex-wrap: wrap;
  padding: 0 12px 8px 12px;
}
.city-hot-item {
  background: #f5f6fa;
  border-radius: 16px;
  color: #888;
  font-size: 15px;
  padding: 8px 24px;
  margin: 0 8px 12px 0;
}
.city-list-card {
  background: #fff;
  border-radius: 16px;
  margin: 16px 16px 0 16px;
  padding: 8px 0 8px 0;
}
.city-list-letter {
  font-size: 15px;
  color: #338aff;
  font-weight: bold;
  margin-left: 20px;
  margin-bottom: 4px;
}
.city-list-item {
  font-size: 16px;
  color: #333;
  padding: 10px 20px;
  border-bottom: 1px solid #f0f0f0;
}
.city-list-item:last-child {
  border-bottom: none;
}
</style>
